package com.blm.common.constants;

/**
 * 缓存常量类
 * 统一管理所有缓存名称
 */
public final class CacheConstant {
    
    private CacheConstant() {
        // 私有构造函数防止实例化
    }
    
    // ============= 用户相关缓存 =============
    /** 用户VO缓存 key = userId */
    public static final String USER_VO = "userVO";
    /** 用户详情缓存 key = username */
    public static final String USER_DETAILS = "userDetails";
    /** 用户基本信息缓存 key = userId / n_username */
    public static final String USER = "user";
      // ============= 店铺相关缓存 =============
    /** 店铺信息缓存 key = storeId */
    public static final String STORE = "store";
    /** 店铺详情缓存 key = storeId */
    public static final String STORE_DETAIL = "storeDetail";
    /** 店铺所有者缓存 key = storeId */
    public static final String STORE_OWNER = "storeOwner";
    /** 用户端店铺列表缓存 key = queryDTO */
    public static final String STORE_LIST_USER = "storeList_user";
    /** 商家端店铺列表缓存 key = merchantId */
    public static final String STORE_LIST_MERCHANT = "storeList_merchant";
    /** 推荐店铺缓存 key = longitude + latitude */
    public static final String STORE_RECOMMEND = "recommendedStores";

    // ============= 商品相关缓存 =============
    /** 商品详情缓存 key = foodId */
    public static final String FOOD_DETAIL = "foodDetail";
    /** 商家查看店铺商品列表缓存 key = storeId + categoryId + status */
    public static final String FOOD_MERCHANT = "foodMerchant";
    /** 用户查看店铺商品列表缓存 key = storeId + categoryId */
    public static final String FOOD_USER = "storeFoods";
    
    // ============= 订单相关缓存 =============
    /** 订单详情缓存 key = orderId */
    public static final String ORDER_DETAIL = "orderDetail";
    /** 店铺订单列表缓存 key = storeId + status + page + size */
    public static final String ORDERS_STORE = "orders_store";
    /** 用户订单列表缓存 key = userId + status + page + size */
    public static final String ORDERS_USER = "orders_user";
    /** 用户订单详情缓存 key = orderId */
    public static final String RIDER_LOCATION = "riderLocation";
    
    // ============= 购物车相关缓存 =============
    /** 用户所有购物车缓存 key = userId */
    public static final String CART_ALL = "carts";
    /** 用户店铺购物车缓存 key = userId + storeId */
    public static final String CART_STORE = "cart_store";
    
    // ============= 收藏相关缓存 =============
    /** 收藏店铺列表分页缓存 key = userId + page + size */
    public static final String FAV_STORE = "fav_store";
    /** 收藏商品列表分页缓存 key = userId + page + size */
    public static final String FAV_FOOD = "fav_food";
    /** 收藏FOOD/STORE查询缓存 key = userId + STORE/FOOD + targetId */
    public static final String FAV_QUERY = "fav_query";
    
    // ============= 历史记录相关缓存 =============
    /** 浏览店铺历史分页缓存 key = userId + page + size */
    public static final String HISTORY_STORE = "history_store";
    /** 浏览商品历史分页缓存 key = userId + page + size */
    public static final String HISTORY_FOOD = "history_food";
    
    // ============= 评价相关缓存 =============
    /** 评价列表缓存 key = storeId + storeRating + page + size */
    public static final String REVIEWS = "reviews";
      // ============= 促销活动相关缓存 =============
    /** 促销活动缓存 key = storeId */
    public static final String PROMOTIONS = "promotions";

    // ============= 地址相关缓存 =============
    /** 地址信息缓存 key = userId */
    public static final String ADDRESS = "address";
    
    // ============= 分类相关缓存 =============
    /** 店铺食物分类缓存
     *  更新时需要删除STORE_DETAIL
     *  key = storeId */
    public static final String CATEGORY_FOOD = "foodCategories";
    /** 店铺分类缓存 key = store */
    public static final String CATEGORIES = "categories";

    // ============= 统计数据 =============
    /** 店铺数据统计 key = storeId + startDate + endDate */
    public static final String STORE_STAT = "storeStat";
    /** 店铺评价统计 key = storeId */
    public static final String REVIEW_STAT = "reviewStat";
}
